<div class="flexform">
    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'customer-ssf-form',
        'enableAjaxValidation' => false
            ));
    ?>
    <div class="row">
        <?php //echo $form->labelEx($model, 'u_id'); ?>
        <?php echo $form->hiddenField($model, 'u_id', array('size' => 11, 'maxlength' => 11)); ?>
        <?php echo $form->error($model, 'u_id', array('class' => 'form-msg-error-advanced')); ?>
    </div>

    <div class="row">
        <ul class="ssf_box">
            <?php
            $ssfs = Ssf::model()->findAll('ssf_type=0');
            foreach ($ssfs as $v):
                $checked = false;
                if (in_array($v->id, $ssf_data))
                    $checked = TRUE;
                ?>
                <li>
                    <label>
                        <b><?php echo $v->ssf_name; ?></b>
                        <span>企业比例：<?php echo $v->business; ?>%</span>
                        <span>个人比例：<?php echo $v->personal; ?>%</span>
                        <span>缴费基数：<?php echo $v->base_number; ?></span>
                        <span><?php echo $v->changes[$v->is_change]; ?></span>
                        <?php echo CHtml::checkBox('ssf_id_box[]', $checked, array('value' => $v->id)); ?>
                    </label>
                </li>
            <?php endforeach; ?>

            <?php
            $ssfs = Ssf::model()->findAll("ssf_type={$customer->ssf_type}");
            foreach ($ssfs as $v):
                $checked = false;
                if (in_array($v->id, $ssf_data))
                    $checked = TRUE;
                ?>
                <li>
                    <label>
                        <b><?php echo $v->ssf_name; ?></b>
                        <span>企业比例：<?php echo $v->business; ?>%</span>
                        <span>个人比例：<?php echo $v->personal; ?>%</span>
                        <span>缴费基数：<?php echo $v->base_number; ?></span>
                        <span><?php echo $v->changes[$v->is_change]; ?></span>
                        <?php echo CHtml::checkBox('ssf_id_box[]', $checked, array('value' => $v->id)); ?>
                    </label>
                </li>
            <?php endforeach; ?>
        </ul>
        <?php echo $form->error($model, 'ssf_id', array('class' => 'form-msg-error-advanced')); ?>
    </div>

    <div class="action">
        <?php echo CHtml::submitButton($model->isNewRecord ? '保存' : '保存'); ?>
    </div>
    <?php $this->endWidget(); ?>
</div><!-- form -->
<div class="clear"></div>
